package SquareFighters.Attack;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;

/**
 *
 * @author Someperson1
 */
public class Sword {

    public int frame;
    int x, y;
    int dir;
    public int uses;
    public Rectangle bounds;

    public Sword(int x, int y, int dir) {
        this.dir = dir;
        switch (dir) {
            case 0:
                this.y = -25 + y;
                this.x = -12 + x;
                break;
            case 1:
                this.y = -12 + y;
                this.x = 15 + x;
                break;
            case 2:
                this.y = 15 + y;
                this.x = x;
                break;
            case 3:
                this.y = y;
                this.x = -25 + x;
                break;
        }
        bounds = new Rectangle(this.x, this.y, 10, 10);
    }

    public void draw(Graphics g) {
        g.setColor(Color.LIGHT_GRAY);
        switch (dir) {
            case 0:
                x += 2;
                break;
            case 1:
                y += 2;
                break;
            case 2:
                x -= 2;
                break;
            case 3:
                y -= 2;
                break;
        }
        frame++;
        bounds.setLocation(x, y);
        g.fillRect(x, y, 10, 10);
    }
}
